package com.shijie.newvideo.pagerslidingtabstrip;

import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.webkit.WebView;

import androidx.viewpager.widget.ViewPager;

/**
 * 关于html：Android Webview：防止将触摸手势传递给父ViewPage
 */
public class MyViewPagerWebView extends ViewPager {
    public MyViewPagerWebView(Context context) {
        super(context);
    }

    public MyViewPagerWebView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    @Override
    protected boolean canScroll(View v, boolean checkV, int dx, int x, int y) {
        if (v instanceof WebView) {
            return true;
        }
        return super.canScroll(v, checkV, dx, x, y);
    }
}
